﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using YasharEl.Infrastructure.ApplicationModel.Bootstrap.Extensibility;
using YasharEl.Infrastructure.ApplicationModel.Bootstrap.Syntax;
using YasharEl.Infrastructure.ApplicationModel.Bootstrap.Reporting;

namespace YasharEl.Infrastructure.ApplicationModel.Bootstrap
{
    /// <summary>
    /// Interface for strategies.
    /// </summary>
    /// <typeparam name="TExtension">The type of the extension.</typeparam>
    public interface IBootstrappingStrategy<TExtension> : IDisposable
        where TExtension : IBootstrappingExtension
    {
        /// <summary>
        /// Creates an executor which is responsible for executing the run syntax.
        /// </summary>
        /// <returns>The run executor.</returns>
        IExecutor<TExtension> CreateRunExecutor();

        /// <summary>
        /// Creates an executor which is responsible for executing the shutdown syntax.
        /// </summary>
        /// <returns>The shutdown executor.</returns>
        IExecutor<TExtension> CreateShutdownExecutor();

        /// <summary>
        /// Creates an executor which is responsible for executing the configure syntax.
        /// </summary>
        /// <returns></returns>
        IExecutor<TExtension> CreateConfigureExecutor();

        /// <summary>
        /// Creates an extension resolver which can resolve extension 
        /// and add them onto the provided extension point
        /// </summary>
        /// <returns>The extension resolver.</returns>
        IBootstrappingExtensionResolver<TExtension> CreateExtensionResolver();

        /// <summary>
        /// Creates a context which is used to track information about the bootstrapping process.
        /// </summary>
        /// <returns>The reporting context.</returns>
        IReportingContext CreateReportingContext();

        /// <summary>
        /// Builds the run syntax.
        /// </summary>
        /// <returns>The run syntax.</returns>
        ISyntax<TExtension> BuildRunSyntax();

        /// <summary>
        /// Builds the shutdown syntax.
        /// </summary>
        /// <returns>The shutdown syntax.</returns>
        ISyntax<TExtension> BuildShutdownSyntax();

        /// <summary>
        /// Builds the configure syntax.
        /// </summary>
        /// <returns>The configure syntax.</returns>
        ISyntax<TExtension> BuildConfigureSyntax();
    }
}
